//
//  MPNewsTableItem.m
//  M800Project
//
//  Created by 姚宗超 on 14/11/10.
//  Copyright (c) 2014年 姚宗超. All rights reserved.
//

#import "MPNewsTableItem.h"
#import "NSString+Business.h"

@implementation MPNewsTableItem

/*
 appUpdateTime = "2014-11-07";
 description = "\U4f60\U524d\U5929\U4e0a\U5348\U82b1449\U5143\U5728\U767e\U76db\U4e70\U4e86\U6761\U88d9\U5b50\Uff0c\U6628\U5929\U4e0b\U5348\U5728\U5c48\U81e3\U6c0f\U82b1\U4e86274\U5143\Uff0c\U6628\U5929\U665a\U4e0a\U5728\U95fd\U6c5f\U8def\U996d\U5e97\U5403\U996d\U82b1\U4e86352\U5143\Uff0c\U4e0a\U5348\U53c8\U53bb\U81ea\U52a8\U63d0\U6b3e\U673a\U4e0a\U53d6\U4e862000\U5143\U94b1   ";
 id = 6696; //
 longUpdateTime = "2014-11-07";
 originUrl = "http://www.meng800.com/article/content-13-6696-1.html";
 thumb = "http://www.meng800.com/article/uploadfile/image/20141107/20141107141551251.jpg"; //
 title = "\U82af\U7247\U5f0f\U94f6\U884c\U5361\U7591\U6cc4\U9732\U9690\U79c1 \U6bd4\U4f60\U8001\U5a46\U66f4\U6e05\U695a\U4f60\U7684\U5237\U5361\U8bb0\U5f55"; //
 updateTime = "2014-11-07";
 url = "http://10.18.6.90:9990/mobile/newsInfo?id=6696"; //
 },
 */
+ (instancetype)itemWithInfoDic:(NSDictionary *)infoDic
{
    MPNewsTableItem* item = [MPNewsTableItem new];
    item.newsId = [infoDic objectForKey:@"id"]; //
    item.newsTitle = [infoDic objectForKey:@"title"]; //
    item.newsContent = [infoDic objectForKey:@"description"]; //
    item.imageUrl = [infoDic objectForKey:@"thumb"]; //
    item.sourceUrl = [infoDic objectForKey:@"url"]; //
    item.shareUrl = [infoDic objectForKey:@"originUrl"];
    item.timeStamp = [[infoDic objectForKey:@"appUpdateTime"] dateFromNewsTableInfo];
    return item;
}
@end
